/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hibernate;

/**
 *
 * @author SBelonozko
 */
public abstract class DBEntity {

    private int id;

    @Override
    public boolean equals(Object obj) {
        if (obj.getClass() != this.getClass()) {
            return false;
        }
        if (this.id == ((DBEntity) obj).id) {
            return true;
        }
        return false;
    }

    @Override
    public int hashCode() {
        return id;
    }
    
    protected void setId(int id) {
        this.id = id;
    }

    /**
     * @return the DBid
     */
    public int getId() {
        return this.id;
    }
}
